package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * Created by LN on 2018/1/3
 */
@Entity
@DynamicInsert
@Table(name = "sign_in_award_mapping")
public class SignInAwardMappingEntity extends BaseEntity {

    private String ruleBaseCode;
    private String awardCode;

    @Basic
    @Column(name = "rule_base_code")
    public String getRuleBaseCode() {
        return ruleBaseCode;
    }

    public void setRuleBaseCode(String ruleBaseCode) {
        this.ruleBaseCode = ruleBaseCode;
    }

    @Basic
    @Column(name = "award_code")
    public String getAwardCode() {
        return awardCode;
    }

    public void setAwardCode(String awardCode) {
        this.awardCode = awardCode;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SignInAwardMappingEntity that = (SignInAwardMappingEntity) o;

        if (ruleBaseCode != null ? !ruleBaseCode.equals(that.ruleBaseCode) : that.ruleBaseCode != null) return false;
        return awardCode != null ? awardCode.equals(that.awardCode) : that.awardCode == null;
    }

    @Override
    public int hashCode() {
        int result = ruleBaseCode != null ? ruleBaseCode.hashCode() : 0;
        result = 31 * result + (awardCode != null ? awardCode.hashCode() : 0);
        return result;
    }
}
